﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace iControl
{
    static class Shared
    {
        public static System.Windows.Media.Imaging.BitmapSource ConvertToBitmapSource(System.Drawing.Bitmap source)
        {
            return System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(source.GetHbitmap(),
                IntPtr.Zero, System.Windows.Int32Rect.Empty,
                System.Windows.Media.Imaging.BitmapSizeOptions.FromWidthAndHeight(source.Width, source.Height));
        }
    }
}
